<template>
    <div>
        <el-upload
                class="upload-demo"
                action="http://127.0.0.1:3000/user/test"
                :on-preview="handlePreview"
                :on-remove="handleRemove"
                :file-list="fileList">
            <el-button size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">上传Excel文件</div>
        </el-upload>
    </div>
</template>
<style>

</style>
<script>
    import axios from 'axios'
    export default{
        data(){
            return{
                fileList: [
                    {name: '111', url: '111'}]
            }
        },
        methods:{
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePreview(file) {
                console.log(file);
            },
            upload(){
                var params = new URLSearchParams();
                params.append('file',this.fileList)
                var _this=this
                axios.post("/user/test",params)
            }
        }
    }
</script>
